class_name BallStateFactory

var states : Dictionary

func _init() -> void:
	states = {
		Ball.State.CARRIED : BallStateCarried,
		Ball.State.FREEDOM : BallStateFreedom,
		Ball.State.SHOOT : BallStateShoot
	}

func get_fresh_state(state:Ball.State) -> BallState:
	assert(states.has(state),"ball state don't exists!")
	return states.get(state).new()
